<tc_include file="Public:header" />
<link rel="stylesheet" media="screen" href="./themes/simplebootx/public/css/fileinput.css" />
  <div id="content-container" class="container">
      <if condition="empty($avatar)">
       <div class="alert alert-warning alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <strong>您还没有头像</strong>。拥有一个独有的头像，老师和同学们能更容易关注到你哦～～ <a href="{:u('user/center/pic')}"" class="alert-link" target="_blank">点击设置</a>
	  </div>
	  <else/>
	    <if condition="empty($user['user_nicename'])">
	     <div class="alert alert-warning alert-dismissable">
          <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
            <strong>您还没设置昵称</strong>。请到个人设置里面设置～～ <a href="{:u('user/center/setting')}" class="alert-link" target="_blank">点击设置</a>
         </div>
        </if>
	 </if>
     <div class="row row-3-9">
        <div class="col-md-3">
           <div class="sidenav">
            <ul class="list-group">
               <li class="list-group-heading"><a href="{:u('Teacher/Center/index')}">我的课程</a></li>
               <li class="list-group-heading">课程管理</li>
               <li class="list-group-item "><a href="{:u('Teacher/Center/sectionlist',array('cs_id'=>$cs_id))}">课时管理</a></li>
			   <if condition="$cs_type==normal">
                 <li class="list-group-item "><a href="{:u('Teacher/Center/addsection',array('cs_id'=>$cs_id))}">添加课时</a></li>
			   <else/>
			     <li class="list-group-item "><a href="{:u('Teacher/Center/addlivesection',array('cs_id'=>$cs_id))}">添加课时</a></li>
			   </if>
               <li class="list-group-item"><a href="{:u('Teacher/Center/material',array('cs_id'=>$cs_id))}">资料管理</a></li>
               <li class="list-group-item"><a href="{:u('Teacher/Center/xueyuanlist',array('cs_id'=>$cs_id))}">学员列表</a></li>
               <li class="list-group-item"><a href="{:u('Teacher/Center/pinglun',array('cs_id'=>$cs_id))}">评论列表</a></li>
			   <li class="list-group-heading">题库管理</li>
			   <li class="list-group-item"><a href="{:u('Teacher/Center/shitilist',array('cs_id'=>$cs_id))}">题目管理</a></li>
			   <li class="list-group-item"><a href="{:u('Teacher/Center/addsection',array('cs_id'=>$cs_id))}">试卷管理</a></li>
			   <li class="list-group-item"><a href="{:u('Teacher/Center/addsection',array('cs_id'=>$cs_id))}">试卷批阅</a></li>
			   <li class="list-group-item"><a href="{:u('Teacher/Center/addsection',array('cs_id'=>$cs_id))}">作业批改</a></li>
            </ul>
          </div>
        </div>
        <div class="col-md-9">	
          <div class="panel panel-default panel-col">
	        <div class="panel-heading">编辑课时《{$cs_name}》</div>
	          <div class="panel-body">
  		  	     <php>
					$tencent=$section['video_type']==1?"checked":"";
					$youku=$section['video_type']==2?"checked":"";
					$isfree=$section['is_free']==0?"checked":"";
              	</php>

                 <div id="myTabContent" class="tab-content">
                    <div class="tab-pane fade in active" id="vodeo">
                       <form id="user-profile-form" class="form-horizontal js-ajax-form" method="post" action="{:U('Teacher/Center/secedit_post')}">
					      <div class="form-group">
						     <label class="col-md-2 control-label">课时标题</label>
						        <div class="col-md-7 controls">
						           <input type="hidden" name="id" value="{$section['id']}" />
						           <input type="hidden" name="cs_id" value="{$section['cs_id']}">
                                   <input type="hidden" name="type_id" value="{$section['type_id']}">
                                   <input type="hidden" name="video_type" id="video_type" value="1">
                                   <input type="hidden" name="section_type" value="1">
							       <input type="text" name="sc_name" id="sc_name" class="form-control" value="{$section['sc_name']}">
						        </div>
					      </div>
					     
					      <div class="form-group">
						     <label class="col-md-2 control-label">播放时长</label>
						        <div class="col-md-7 controls">
							       <input type="text" name="sc_time" class="form-control" value="{$section.sc_time}">
						        </div>
					      </div>
					      <div class="form-group" id="video">
						       <label class="col-md-2 control-label">播放地址</label>
						       <label class="checkbox-inline">
                                  <input type="radio" name="radio"  value="1" {$tencent}  onchange="radioSwitch(this)" >云存储
                               </label>
                               <label class="checkbox-inline">
                                  <input type="radio" name="radio"  value="2" {$youku} onchange="radioSwitch(this)">视频网站
                              </label>  
					      </div>
					      <div class="form-group">
						      <if condition="$section['video_type']==1"> 
					            <div id="yun" class="col-md-7 controls col-md-offset-2">
                                  <input type='text' name='yun_url' id="yun_url" value='{$section.yun_url}' style='width:370px;float:left;margin-right:20px;'   class='form-control' >
                                  <a class="btn btn-primary " href="{:u('Teacher/Center/ziyuanku2')}" data-toggle="modal" data-target="#myModal">资料库</a>
								</div>	
                                <div id="youku" class="col-md-7 controls col-md-offset-2">
                                   <input type='text' name='youku_url' value='' style='width:355px;float:left;margin-right:20px;'   class='form-control' placeholder="优酷的分享视频地址！">
                                   <input type='text' name='playpass' value='' style='width:90px;'   class='form-control' placeholder="播放密码">
			                    </div>
							  <else/> 
							    <div id="yun" class="col-md-7 controls col-md-offset-2">
                                  <input type='text' name='yun_url' id="yun_url" value='' style='width:370px;float:left;margin-right:20px;'   class='form-control' >
                                  <a class="btn btn-primary " href="{:u('Teacher/Center/ziyuanku2')}" data-toggle="modal" data-target="#myModal">资料库</a>
								</div>	
                                <div id="youku" class="col-md-7 controls col-md-offset-2">
                                   <input type='text' name='youku_url' value='{$section.yun_url}' style='width:355px;float:left;margin-right:20px;'   class='form-control' placeholder="优酷的分享视频地址！">
                                   <input type='text' name='playpass' value='{$section.playpass}' style='width:90px;'   class='form-control' placeholder="播放密码">
			                    </div>
							  </if>
								
						  </div>
					       <div class="row">
						       <div class="col-md-7 col-md-offset-2">
							      <button id="profile-save-btn"  type="submit" class="btn btn-primary js-ajax-submit">提交</button>
						       </div>
					       </div>
			           </form>
                    </div>
                    <div class="tab-pane fade in " id="ppt">
                       <div class="form-group">
					      <div id="yun" class="col-md-7 controls col-md-offset-2">
					               
                             <input id="file-1" class="file"  name="upvideo" type="file" multiple data-min-file-count="1" >
                                  
                          </div>
			                   
					   </div>
                    </div>
                   <div class="tab-pane fade" id="ziliao">
                      <div class="form-group">
					     <div id="yun" class="col-md-7 controls col-md-offset-2">
					              
                             <input id="file-1" class="file"  name="upvideo" type="file" multiple data-min-file-count="1" >
                                  
                         </div>
			                   
					  </div>
                   </div>
                  
                 </div>	   
		      </div>
	        </div>
         </div>
     </div>
   </div>
 <div class="modal fade" id="myModal" tabindex="-1" role="dialog"  aria-labelledby="myModalLabel" aria-hidden="true">
   <div class="modal-dialog">
      <div class="modal-content">
         <div class="modal-body">
          
         </div>
      </div>
   </div>
</div>  

<tc_include file="Public:scripts" /> 
<script type="text/javascript" src="__PUBLIC__/js/content_addtop.js"></script>
<script>
var val = $('#video input[name="radio"]:checked ').val();
if(val==1){
	document.getElementById('yun').style.display = "";
	document.getElementById('youku').style.display = "none";
	}else{
		document.getElementById('yun').style.display = "none";
		document.getElementById('youku').style.display = "";
		}
 
function radioSwitch(){
	var val = $('#video input[name="radio"]:checked ').val();
	if(val==1){
		document.getElementById('yun').style.display = "";
		document.getElementById('youku').style.display = "none";
		document.getElementById("video_type").value='1';
		}else{
			document.getElementById('yun').style.display = "none";
			document.getElementById('youku').style.display = "";
			document.getElementById("video_type").value='2';
			}
	 
}
</script>  
<tc_include file="Public:footer" />